import request from '@/utils/request'

/**
 * 排除已绑定关键词的列表
 * @param {{
 *  page: number
 *  limit: number
 *  tariff_id: number
 *  word: string
 * }} data
 * @returns
 */
export function unBind(data) {
  return request({
    url: '/tax.Word/unBind',
    method: 'post',
    data
  })
}

export function handleList(data) {
  return request({
    url: '/tax.Word',
    method: 'post',
    data
  })
}

export function handleEdit(queryData) {
  return request({
    url: '/tax.Word/handleEdit',
    method: 'post',
    data: queryData
  })
}

export function handleAdd(queryData) {
  return request({
    url: '/tax.Word/handleAdd',
    method: 'post',
    data: queryData
  })
}

export function handleDel(queryData) {
  return request({
    url: '/tax.Word/handleDel',
    method: 'post',
    data: queryData
  })
}

export function bindWord(queryData) {
  return request({
    url: '/tax.Word/bindWord',
    method: 'post',
    data: queryData
  })
}

/**
 * 添加并绑定词库没有的词
 * @param {{
 *  tariff_id: number
 *  word: string
 * }} queryData
 * @returns
 */
export function addWord(queryData) {
  return request({
    url: '/tax.word/addWord',
    method: 'post',
    data: queryData
  })
}

/**
 * 获取已绑定的关键词
 * @param {{
 *  id: number
 *  word: string
 * }} queryData
 */
export function getBoundWords(queryData) {
  return request({
    url: '/tax.Word',
    method: 'post',
    data: queryData
  })
}

/**
 * 删除关键词
 * @param {{
 *  tariff_id: number
 *  word_id: string
 * }} queryData
 * @returns
 */
export function deleteWords(queryData) {
  return request({
    url: '/tax.Word/bindDel',
    method: 'post',
    data: queryData
  })
}
